<script setup lang="ts">
import { ref, onMounted, onUnmounted } from "vue"
import { emitter } from "base/utils"
const emitterValue =  ref({name: "test"})

onMounted(() => {
    // 子应用A
    emitter.on('changeEmitter', (data:any) => {
      console.log("主应用接收到数据:", data);
      emitterValue.value = data
    });
})

</script>

<template>
  <div>
     <div>这是主框架</div>
     <div>这是emitter 的值
      {{ JSON.stringify(emitterValue) }}
     </div>
    <router-link to="/home"> 到home页面</router-link>
    <div>
      <router-link to="/vue-app">跳转到子应用</router-link>
    </div>
  </div>
  <RouterView />
  <div id="childrenApp"></div>
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
